
import cherrypy
import environment
from abio.util import template
from abio.util import authorization
from abio.util import session
from pyamf.remoting.gateway.wsgi import WSGIGateway

from amf import echo
from amf import echo2

amf = {
    'echo': echo,
    'echo2': echo2,
}

class url(object):
    def __init__(self):
        pass
    
    @template.void
    def swf(self, *para):
        cherrypy.response.headers['Content-Type']='application/x-shockwave-flash' 
        path=''
        for temppath in para:
            path+='/'+str(temppath)
        print path;
        return open(environment.system['path_swf_file']+path,'rb') 
    
    @template.void
    @authorization.role('user')
    def index(self):
        return self.swf(self, '../file.swf')
    
